using System;
using System.Collections.Generic;
using System.Text;
using System.Windows.Forms;

namespace SystemHotKeysLib
{
    /// <summary>
    /// Contains windows APIs used in this library.
    /// </summary>
    class Api
    {
        /// <summary>
        /// Registers a system hot key.
        /// </summary>
        /// <param name="hWnd">Handle of the window.</param>
        /// <param name="id">Hot key identifier.</param>
        /// <param name="fsModifiers">Key modifiers.</param>
        /// <param name="vk">Virtual key code.</param>
        /// <returns></returns>
        [System.Runtime.InteropServices.DllImport("user32.dll")]
        public static extern bool RegisterHotKey(
            IntPtr hWnd,
            int id,
            uint fsModifiers,
            Keys vk
        );

        /// <summary>
        /// Unregisters a system hot key.
        /// </summary>
        /// <param name="hWnd">Handle of the window.</param>
        /// <param name="id">Hot key identifier.</param>
        /// <returns></returns>
        [System.Runtime.InteropServices.DllImport("user32.dll")]
        public static extern bool UnregisterHotKey(
            IntPtr hWnd,
            int id
        );

        /// <summary>
        /// The windows message that indicates a hot key was pressed.
        /// </summary>
        public const int WM_HOTKEY = 0x0312;
    }
}
